package org.obeonetwork.dsl.spem.extension.ifest.ontology;


public class OWLSesameAdapteur {
/*public static void ConvertSesameGraph2OWL(Graph sesameGraph, String context, String fileName)
{
	OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
	File file = new File (fileName);
	OWLDataFactory factory = manager.getOWLDataFactory();
	
	try {
		IRI instanceIRI = IRI.create(context);
		IRI ifestIRI = IRI.create("http://www.obeonetwork.org/ontologies/spem/ifest.owl");
		PrefixManager pmIfest = new DefaultPrefixManager(ifestIRI.toString()+"#");
		PrefixManager pmInstance = new DefaultPrefixManager(instanceIRI.toString()+"#");
		//creer un nouvel ontologies pour les instances.
		
		OWLOntology ontology = manager.createOntology(instanceIRI);
//		OWLImportsDeclaration importDecla = factory.getOWLImportsDeclaration(ifestIRI);
//		manager.applyChange(new AddImport(ontology, importDecla));
		OWLClass clsEngineeringDomain = factory.getOWLClass(":EngineeringDomain",pmIfest);
		OWLClass clsViewpoint = factory.getOWLClass(":Viewpoint",pmIfest);
		Statement st =(Statement)sesameGraph.iterator(); 
		while (st!=null)
		{
				OWLNamedIndividual indiv = factory.getOWLNamedIndividual(":"+e.getName().replaceAll(" ", "_"),pmInstance);
				OWLClassAssertionAxiom enginDomainAssertion = factory.getOWLClassAssertionAxiom(clsEngineeringDomain, indiv);
				manager.addAxiom(ontology, enginDomainAssertion);
				for (Viewpoint v:e.getViewpoints())
				{
					OWLNamedIndividual indivViewpoint = factory.getOWLNamedIndividual(":"+v.getName().replaceAll(" ","_"),pmInstance);
					OWLClassAssertionAxiom assertionViewpoint = factory.getOWLClassAssertionAxiom(clsViewpoint, indivViewpoint);
					manager.addAxiom(ontology, assertionViewpoint);
				}
		}
		try {
			RDFXMLOntologyFormat format = new RDFXMLOntologyFormat();
			format.setPrefix("ins", pmInstance.getDefaultPrefix());
			manager.saveOntology(ontology,format,IRI.create(file.toURI()));
			OWLIMTool.addOWL(file.getAbsolutePath(), instanceIRI.toString());
		} catch (OWLOntologyStorageException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		
					
	} catch (OWLOntologyCreationException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
}*/
}
